<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8">
            <title>淘天机站群系统管理后台</title>
            <!-- include header_meta -->
    </head>
    <body>
        <!-- include header -->
        <div class="cp-wrap">
            <div class="crumb"></div>

            <div class="cp-form">
                <form method="POST" class="AjaxPost"  onsubmit="return false;">

                    <div>
                        <h1 onclick="hideCon()">上传须知</h1></div>
                    <div style="padding: 8px;border:dashed 1px #ccc; margin: 5px 0;">
                        <p>上传文件必须是.xls,.xlsx文件</p>
                        <p style="color:red;">正在上传中,请不要刷新页面，请耐心等待，上传成功页面会自动刷新</p>
                    </div>

                    <div id="uploader" class="wu-example">
                        <!--用来存放文件信息-->
                        <div id="file_upload">上传文件</div>
                    </div>
            </div>
            <div id="msg"></div>
            </form>		
        </div>
        </div>
        <!-- include footer -->
        <script type="text/javascript" src="__APPROOT__/js/layer/layer.js"></script>
        <script>
            $(function () {
                var uploader = WebUploader.create({
                    auto: true,
                    swf: '__APPROOT__/js/webuploader.swf',
                    server: '?m=import&a=uploads',
                    pick: '#file_upload',
                    accept: {
                        title: 'intoTypes',
                        extensions: 'xls,xlsx',
                        mimeTypes: 'application/vnd.ms-excel application/x-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
                    }
                });
                uploader.on('uploadSuccess', function(file, res) {
                    if(res.status==1) {
                        cpAlert('上传成功，共：'+res.result.suc+'条数据，即将开始处理...',2);
                        window.location.href="?m=import&a=doing";
                    }else {
                        cpAlert(res.message);
                    }
                });
            });
        </script>
    </body>
</html>